Role of <!DOCTYPE html>
The <!DOCTYPE html> declaration tells the browser which version of HTML the document is written in. In modern web development, it is used to specify HTML5, which ensures that the page is rendered in standards mode rather than quirks mode.
It must be the very first line in an HTML document.
It tells the browser to use the HTML5 standard for rendering.
Without it, browsers may switch to quirks mode, leading to inconsistent display.
It is not an HTML tag, but a declaration.